#include<stdio.h>
int main()
{
	int count=0;
	char ch=0;
	while((ch=getchar())!=EOF)
	{
		if(ch=='{')
			count++;
		else if(ch=='}')
		{
			if(count==0)
			{
				printf("not match!!!\n");
				return 1;
			}
			count--;
		}
	}
	if(count>0)
	{
		printf("not match!!!\n");
		return 1;
	}
	return 0;
}
